import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { LoadingController } from '@ionic/angular';

@Component({
  selector: 'app-progress',
  templateUrl: './progress.page.html',
  styleUrls: ['./progress.page.scss'],
})
export class ProgressPage implements OnInit {

  constructor(private router: Router, public loadingController: LoadingController) { }

  ngOnInit() {
  }

  gotohome(){
    this.router.navigate(['/tabs/tab2'])
  }

  async presentLoading() {
    const loading = await this.loadingController.create({
      message: '加载中',
      animated: true,
      duration: 2000
    });
    await loading.present();
  }

  async presentLoadinga() {
    const loading = await this.loadingController.create({
      message: '加载中',
      duration: 2000
    });
    await loading.present();
  }
  
  async presentLoadingb() {
    const loading = await this.loadingController.create({
      message: '加载中',
      cssClass: 'myloading',
      duration: 2000
    });
    await loading.present();
  }

  async presentLoadingc() {
    const loading = await this.loadingController.create({
      message: '加载中',
      duration: 5000
    });
    await loading.present();
  }

  async presentLoadingd() {
    const loading = await this.loadingController.create({
      message: '加载中',
      showBackdrop: false,
      duration: 2000
    });
    await loading.present();
  }

  async presentLoadinge() {
    const loading = await this.loadingController.create({
      message: '加载中',
      translucent: true,
      duration: 2000
    });
    await loading.present();
  }
}
